﻿<%@ Page Title="" Language="C#" MasterPageFile="~/User/User.Master" AutoEventWireup="true"
    CodeBehind="User_Add.aspx.cs" Inherits="CoolERP_Web.User.User_Add" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <style type="text/css">
        .style1
        {
            text-align: right;
        }
    </style>
    <script type="text/javascript">
        function checkType() {

            //得到上传文件的值   
            var fileName = document.getElementById("PhotoFileUpload").value;

            //返回String对象中子字符串最后出现的位置.   
            var seat = fileName.lastIndexOf(".");

            //返回位于String对象中指定位置的子字符串并转换为小写.   
            var extension = fileName.substring(seat).toLowerCase();

            //判断允许上传的文件格式   
            //if(extension!=".jpg"&&extension!=".jpeg"&&extension!=".gif"&&extension!=".png"&&extension!=".bmp"){   
            //alert("不支持"+extension+"文件的上传!");   
            //return false;   
            //}else{   
            //return true;   
            //}   

            var allowed = [".jpg", ".gif", ".png", ".bmp", ".jpeg"];
            for (var i = 0; i < allowed.length; i++) {
                if (!(allowed[i] != extension)) {
                    return true;
                }
            }
            alert("不支持" + extension + "格式");
            return false;
        }  
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td class="tbHead_L">
            </td>
            <td class="tbHead_M">
                <div id="headdiv" runat="server">
                    <b>新增员工</b>
                    </div>
            </td>
            <td class="tbHead_R">
            </td>
        </tr>
        <tr>
            <td class="tbBody_L">
            </td>
            <td class="tbBody_M">
                <div style="float: left; width: 540px; margin-right: 30px">
                    <table border="0" width="100%" style="height: 100%;">
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                工号:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbCode" runat="server" MaxLength="8"></asp:TextBox>
                                <span class="style1" style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator4"
                                    runat="server" ControlToValidate="tbCode" Display="Dynamic" ErrorMessage="*"
                                    ForeColor="Red">请输入工号</asp:RequiredFieldValidator>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                IC卡ID:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbICCard" runat="server" MaxLength="10"></asp:TextBox>
                                <%--<span class="style1">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbICCard"
                                        Display="Dynamic" ForeColor="Red">请输入IC卡ID</asp:RequiredFieldValidator>
                                </span>--%>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                姓名:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbName" runat="server" MaxLength="16"></asp:TextBox>
                                <span class="style1" style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator5"
                                    runat="server" ControlToValidate="tbName" Display="Dynamic" ErrorMessage="*"
                                    ForeColor="Red">请输入姓名</asp:RequiredFieldValidator>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                身份证号:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbIdNumber" runat="server" MaxLength="18"></asp:TextBox>
                                <span class="style1" style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator6"
                                    runat="server" ControlToValidate="tbIdNumber" Display="Dynamic" ErrorMessage="*"
                                    ForeColor="Red">身份证号码</asp:RequiredFieldValidator>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                籍贯:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbHomeTown" runat="server" MaxLength="16"></asp:TextBox>
                                <span class="style1" style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator7"
                                    runat="server" ControlToValidate="tbHomeTown" Display="Dynamic" ErrorMessage="*"
                                    ForeColor="Red">精确到省市</asp:RequiredFieldValidator>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                档案号:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbArchives" runat="server" MaxLength="16"></asp:TextBox>
                                <span class="style1" style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
                                    runat="server" ControlToValidate="tbArchives" Display="Dynamic" ErrorMessage="*"
                                    ForeColor="Red">请输入数字</asp:RequiredFieldValidator>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                性别:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:RadioButtonList ID="rbGender" runat="server" RepeatDirection="Horizontal"
                                    RepeatLayout="Flow">
                                    <asp:ListItem Value="0">女</asp:ListItem>
                                    <asp:ListItem Selected="True" Value="1">男</asp:ListItem>
                                </asp:RadioButtonList>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                密码:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbPassword" runat="server" TextMode="Password" MaxLength="16"></asp:TextBox>
                                <span class="style1" style="color: #FF0000">*<asp:RequiredFieldValidator ID="RequiredFieldValidator3"
                                    runat="server" ControlToValidate="tbPassword" Display="Dynamic" ErrorMessage="*"
                                    ForeColor="Red">请输入密码</asp:RequiredFieldValidator>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                生日:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbBirthday" runat="server" CssClass="Wdate textbox" MaxLength="16"
                                    onfocus="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                电话:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbTel" runat="server" MaxLength="32"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                手机:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbMobile" runat="server" MaxLength="11"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                邮箱:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbEmail0" runat="server" ></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                照片:
                            </td>
                            <td style="text-align: left;">
                                <asp:FileUpload ID="PhotoFileUpload" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px; text-align: right;">
                                住址:
                            </td>
                            <td style="text-align: left;">
                                &nbsp;<asp:TextBox ID="tbAddress" runat="server" Height="43px" MaxLength="32" TextMode="MultiLine"
                                    Width="297px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td><asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/Images/Common/btn_save0.png"
                        OnClick="btnSave_OnClick" OnClientClick="return checkType()" />&nbsp;
                    <asp:ImageButton ID="btnBack" runat="server" ImageUrl="~/Images/Common/btn_back0.png"
                        CausesValidation="false"  OnClick="btnBack_OnClick" />
                                <asp:Label ID="lbResult" runat="server" ForeColor="Red"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
            <td class="tbBody_R">
            </td>
        </tr>
        <tr>
            <td class="tbFoot_L">
            </td>
            <td class="tbFoot_M">
            </td>
            <td class="tbFoot_R">
            </td>
        </tr>
    </table>
</asp:Content>
